package cn.ffcs.uec.outStaff.action;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.taglibs.standard.tag.common.fmt.SetBundleSupport;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.media.AMedia;
import org.zkoss.web.servlet.Servlets;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Components;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zul.Filedownload;

import cn.ffcs.raptornuke.plugin.common.zk.ctrl.BasePortletComposer;
import cn.ffcs.raptornuke.plugin.common.zk.util.ZkUtil;
import cn.ffcs.raptornuke.portal.kernel.xml.DocumentException;
import cn.ffcs.raptornuke.portal.theme.ThemeDisplay;
import cn.ffcs.uec.common.util.PermissionUtil;
import cn.ffcs.uec.common.vo.UecBdDefdoc;
import cn.ffcs.uec.outStaff.action.bean.UecOutStaffInfomationMainBean;
import cn.ffcs.uec.outStaff.manager.UecOutStaffInfomationManager;
import cn.ffcs.uec.outStaff.manager.UecOutStaffManager;
import cn.ffcs.uec.outStaff.model.UecOutStaffInfo;
import cn.ffcs.uec.outStaff.vo.UecOutStaffInfomationVo;
import cn.ffcs.uec.staff.manager.UecAssManager;
import cn.ffcs.uec.staff.manager.UecDocEduManager;
import cn.ffcs.uec.staff.manager.UecEncManager;
import cn.ffcs.uec.staff.manager.UecWorkManager;
import cn.ffcs.uec.staff.model.UecAss;
import cn.ffcs.uec.staff.model.UecDocEdu;
import cn.ffcs.uec.staff.model.UecEnc;
import cn.ffcs.uec.staff.model.UecWork;
import cn.ffcs.uec.view.manager.LogDownManager;
import cn.ffcs.uec.view.model.LogDown;
import cn.ffcs.uom.common.model.DefaultDaoFactory;
import cn.ffcs.uom.common.util.ApplicationContextUtil;
import cn.ffcs.uom.common.util.IPortletInfoProvider;
import cn.ffcs.uom.common.util.ListboxUtils;
import cn.ffcs.uom.common.util.PlatformUtil;
import cn.ffcs.uom.common.util.StrUtil;
import cn.ffcs.uom.common.util.UomZkUtil;
import cn.ffcs.uom.common.vo.NodeVo;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPRow;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
/**
 * @desc 外包转置pdf表格设计
 * @author BMP
 * @time 2018-12-4
 */
@Controller
@Scope("prototype")
public class UecOutStaffInfomationMainComposer extends BasePortletComposer
		implements IPortletInfoProvider {
	private static final long serialVersionUID = -139335897781983790L;

	private UecOutStaffInfomationMainBean bean = new UecOutStaffInfomationMainBean();
	
	private UecOutStaffInfomationVo uecOutStaffInfomationVo = new UecOutStaffInfomationVo();
	
	private UecOutStaffInfo uecOutStaffInfo = new UecOutStaffInfo();

	private UecOutStaffInfomationManager uecOutStaffInfomationManager = (UecOutStaffInfomationManager) ApplicationContextUtil
			.getBean("uecOutStaffInfomationManager");
	private UecAssManager uecAssManager = (UecAssManager) ApplicationContextUtil
			.getBean("uecAssManager");
	private UecWorkManager uecWorkManager = (UecWorkManager) ApplicationContextUtil
			.getBean("uecWorkManager");
	private UecEncManager uecEncManager = (UecEncManager) ApplicationContextUtil
			.getBean("uecEncManager");
	private UecDocEduManager uecEduManager = (UecDocEduManager) ApplicationContextUtil
			.getBean("uecDocEduManager");

	private UecOutStaffManager uecOutStaffManager = (UecOutStaffManager) ApplicationContextUtil
			.getBean("uecOutStaffManager");
	private LogDown logDown = new LogDown();
	
	private LogDownManager logDownManager = (LogDownManager) ApplicationContextUtil
			.getBean("logDownManager");
	private SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:MM:SS");
	private SimpleDateFormat df1 = new SimpleDateFormat("yyyy-MM");
	/**
	 * 共用字段
	 */
	private String joinCategory;//报考类别
	private String origedu;//原始学历
	private String origSchool;//原始学历毕业院校
	private String origMajor;//原始学历专业
	private String nXgrade;//内训师级别
	private Date nXbegindate;//内训师聘期开始时间
	private Date nXenddate;//内训师聘期开始时间
	private String downflag;//是否报名
	private String nXlist="";
	@Override
	public String getPortletId() {
		return super.getPortletId();
	}

	@Override
	public ThemeDisplay getThemeDisplay() {
		return super.getThemeDisplay();
	}

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		UomZkUtil.autoFitHeight(comp);
		Components.wireVariables(comp, bean);
	}

	/**
	 * 初始化窗口
	 * 
	 * @throws ParseException
	 * @throws InterruptedException 
	 */
	public void onCreate$uecOutStaffInfomationMainWin() throws ParseException, InterruptedException {
		this.binbBean();
		this.bindCombobox();
		initLogDown();
		String joinCategory = "";
		try {
			byte[] bsPdfView = createPDF(joinCategory);
			org.zkoss.util.media.Media media = new AMedia(null, null, "application/PDF", bsPdfView);
            bean.getIframePdf().setHeight("600px");
            bean.getIframePdf().setContent(media);
		} catch (DocumentException e) {			
			e.printStackTrace();
		} catch (IOException e) {			
			e.printStackTrace();
		} catch (com.itextpdf.text.DocumentException e) {
			e.printStackTrace();
		}
	}

	/**
	 * 绑定combobox
	 */
	private void bindCombobox() {
		//获取登录人当前组织
		String currentOrgName = PermissionUtil.getCurrentOrgName();
		List<NodeVo> joinCategoryList = new ArrayList<NodeVo>();
		if("内蒙古分公司本部".equals(currentOrgName)){
			String[][] glbdef10 = { { "前端经营类", "前端经营类" }, { "后端支撑类", "后端支撑类" },
					{ "管控职能类", "管控职能类" }, { "财务类", "财务类" },
					{ "客服呼叫座席类", "客服呼叫座席类" } };
			for (int i = 0; i < glbdef10.length; i++) {
				NodeVo nodeVo = new NodeVo();
				for (int j = 0; j < 1; j++) {
					nodeVo.setId(glbdef10[i][j]);
					nodeVo.setName(glbdef10[i][j + 1]);
				}
				joinCategoryList.add(nodeVo);
			}
			ListboxUtils.rendererForEdit(bean.getJoinCategory(), joinCategoryList);
		}else{
			String[][] glbdef10 = { { "前端经营类", "前端经营类" }, { "后端支撑类", "后端支撑类" },
					{ "管控职能类", "管控职能类" }, { "财务类", "财务类" }
					 };
			for (int i = 0; i < glbdef10.length; i++) {
				NodeVo nodeVo = new NodeVo();
				for (int j = 0; j < 1; j++) {
					nodeVo.setId(glbdef10[i][j]);
					nodeVo.setName(glbdef10[i][j + 1]);
				}
				joinCategoryList.add(nodeVo);
			}
			ListboxUtils.rendererForEdit(bean.getJoinCategory(), joinCategoryList);
		}
		List<NodeVo> origeduList = new ArrayList<NodeVo>();
		String[][] glbdef12 = { { "中专", "中专" }, { "高中", "高中" },
				{ "技工学校", "技工学校" }, { "初中", "初中"},
				{ "小学", "小学" } };
		for (int i = 0; i < glbdef12.length; i++) {
			NodeVo nodeVo = new NodeVo();
			for (int j = 0; j < 1; j++) {
				nodeVo.setId(glbdef12[i][j]);
				nodeVo.setName(glbdef12[i][j + 1]);
			}
			origeduList.add(nodeVo);
		}
		ListboxUtils.rendererForEdit(bean.getOrigedu(), origeduList);
	}
	
	/**
	 * 获取全局变量，绑定数据导页面
	 * @Title: binbBean   
	 * @Description: TODO 
	 * @param: @throws InterruptedException      
	 * @return: void      
	 * @throws
	 */
	private void binbBean() throws InterruptedException{
		if (StrUtil.isNullOrEmpty(PlatformUtil.getCurrentUser())) {
			ZkUtil.showError("当前登录用户不存在!", "错误提示");
			return;
		} else {
			String screenName = PlatformUtil.getCurrentUser().getScreenName();
			//uecOutStaffInfomationVo.setPsnCode(screenName.toUpperCase().substring(1));
			uecOutStaffInfomationVo.setPsnCode(screenName.toUpperCase());
			uecOutStaffInfomationVo = uecOutStaffInfomationManager
					.qryUecOutStaffContractByUecOutStaffInfo(uecOutStaffInfomationVo);
		}
		if (uecOutStaffInfomationVo != null) {
			uecOutStaffInfo.setOutStaffId(uecOutStaffInfomationVo
					.getOutStaffId());
		}else{
			bean.getSavePdf().setDisabled(true);
		}
		uecOutStaffInfo = uecOutStaffManager
				.findUecOutStaffInfoById(uecOutStaffInfo);
		if (null == uecOutStaffInfo) {
			bean.getSavePdf().setDisabled(true);
			Messagebox.show("人员信息获取失败！");
			return;
		}
	}

	/**
	 * @throws ParseException 
	 * @throws InterruptedException
	 *             员工报名表导出按钮，通过按钮触发
	 * @Title: onOk
	 * @Description: TODO
	 * @param:
	 * @return: void
	 * @throws
	 */
	public void onOk() throws InterruptedException, ParseException {
		try {
			if(StrUtil.isNullOrEmpty(joinCategory)) {
				if (null == bean.getJoinCategory().getSelectedItem().getValue()) {
					Messagebox.show("请选择参加选聘报考类别");
					return;
				}
			}
			if(StrUtil.isNullOrEmpty(origedu)) {
				if (null == bean.getOrigedu().getSelectedItem().getValue()) {
					Messagebox.show("请选择原始学历");
					return;
				}
			}
			if(!StrUtil.isNullOrEmpty(origedu) && !"无".equals(origedu)) {
				
					if(StrUtil.isNullOrEmpty(origSchool)) {
						if (null == bean.getOrigeduschool().getValue()) {
							Messagebox.show("请填写原始学历毕业院校");
							return;
						}
					}
					if(StrUtil.isNullOrEmpty(origMajor)) {
						if (null == bean.getOrigeduMajor().getValue()) {
							Messagebox.show("请填写原始学历专业");
							return;
						}
					}
				
			}
			if(StrUtil.isNullOrEmpty(nXlist)) {
				if (null == bean.getNxGrade().getValue()) {
					Messagebox.show("请填写内训师级别");
					return;
				}
					if (null == bean.getNxBegindate().getValue()) {
						Messagebox.show("请填写内训师聘期开始时间");
						return;
					}
					if (null == bean.getNxEnddate().getValue()) {
						Messagebox.show("请填写内训师聘期结束时间");
						return;
					}
			}
			joinCategory = (String) bean.getJoinCategory()
					.getSelectedItem().getValue();
			origedu = (String)bean.getOrigedu().getSelectedItem().getValue();
			origMajor =  bean.getOrigeduMajor().getValue();
			 origSchool =  bean.getOrigeduschool().getValue();
			 nXgrade = bean.getNxGrade().getValue();
			  nXbegindate= bean.getNxBegindate().getValue();
			 nXenddate = bean.getNxEnddate().getValue();
			byte[] bsPdf = createPDF(joinCategory);
			
			String charset = "UTF-8";
            // 图片名称
            String fileName = "报名表";
            // 编码后文件名
            String encodedName = null;
            encodedName = URLEncoder.encode(fileName, charset);
            // 将空格替换为+号
            encodedName = encodedName.replace("%20", "+");
            HttpServletRequest httpRequest = (HttpServletRequest) Executions.getCurrent()
                    .getNativeRequest();
            // 解决ie6 bug 或者是火狐浏览器
            if (encodedName.length() > 150 || Servlets.isGecko(httpRequest)
                    || Servlets.isGecko3(httpRequest)) {
                encodedName = new String(fileName.getBytes(charset), "ISO8859-1");
            }
            //把人员参考类别更新进信息表中
           // uecOutStaffInfo.setJoinCategory((String)bean.getJoinCategory().getSelectedItem().getValue());
           // uecOutStaffInfo.updateOnly();
			Filedownload.save(bsPdf, "application/PDF", fileName);
			
		} catch (DocumentException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (com.itextpdf.text.DocumentException e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * 提交按钮
	 * @throws Exception
	 */
	public void onSubmit() throws Exception {
		if(logDown != null) {
			ZkUtil.showQuestion("确信信息无误吗?", "提示信息", new EventListener() {
				public void onEvent(Event event) throws Exception {
					Integer result = (Integer) event.getData();
					if (result == Messagebox.OK) {
						logDown.setOpenswitch("Y");
						downflag="是";
						logDown.setDowntime(df.format(new Date()));
						logDown.setDownflag(downflag);
					    logDown.updateOnly();
					    Messagebox.show("报名成功！");
						onRefresh();
					}
				}
			});
		}else {
			Messagebox.show("报名失败");
			this.onRefresh();
		}

	}
	/**
	 * @throws ParseException 
	 * @throws InterruptedException
	 *             员工报名表导出按钮，通过按钮触发
	 * @Title: onOk
	 * @Description: TODO
	 * @param:
	 * @return: void
	 * @throws
	 */
	public void onRefresh() throws InterruptedException, ParseException {
		try {
			boolean flag = getLogDown(logDown);
			if("N".equals(logDown.getOpenswitch())) {
	    		bean.getSubmitButton().setVisible(true);
	    		//bean.getSaveButton().setVisible(true);
	    		bean.getYetSubmitButton().setVisible(false);
	    	}else {
	    		bean.getSubmitButton().setVisible(false);
	    		//bean.getSaveButton().setVisible(false);
	    		bean.getYetSubmitButton().setVisible(true);
	    	}
			byte[] bsPdf = createPDF("");
			org.zkoss.util.media.Media media = new AMedia(null, null, "application/PDF", bsPdf);
	        bean.getIframePdf().setHeight("600px");
	        bean.getIframePdf().setContent(media);
		} catch (DocumentException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} catch (com.itextpdf.text.DocumentException e) {
			e.printStackTrace();
		}
	}

	/**
	 * @throws com.itextpdf.text.DocumentException
	 * @desc 生成pdf
	 * @return: byte[] pdf二进制文件
	 * @throws DocumentException
	 * @throws IOException
	 * @throws com.itextpdf.text.DocumentException
	 * @throws ParseException 
	 * @throws InterruptedException
	 */
	public byte[] createPDF(String joinCategory) throws DocumentException,
			IOException, com.itextpdf.text.DocumentException, ParseException {
		int y, m, d;
		Calendar cal = Calendar.getInstance();
		y = cal.get(Calendar.YEAR);
		m = cal.get(Calendar.MONTH);
		d = cal.get(Calendar.DATE);
		// 考核
		List<UecAss> findUecAssByStaffId = uecAssManager
				.findUecAssByStaffId(uecOutStaffInfo);
		// 履历
		List<UecWork> queryPageInfoByUecStaffId = uecWorkManager
				.queryPageInfoByUecStaffId(uecOutStaffInfo);
		String uecworkString="";
		if( queryPageInfoByUecStaffId!=null && queryPageInfoByUecStaffId.size()>0) {
			for(UecWork uecWork:queryPageInfoByUecStaffId) {
					uecWork.getDataCollection();
					uecworkString=uecworkString+(!StrUtil.isNullOrEmpty(uecWork.getWorkcorp())?uecWork.getWorkcorp():"--")+
							    "     "+(!StrUtil.isNullOrEmpty(uecWork.getWorkdept())?uecWork.getWorkdept():"--")+"    "+(!StrUtil.isNullOrEmpty(uecWork.getWorkpost())?uecWork.getWorkpost():"--")+"\r\n";
				}
		}else {
			uecworkString="无";
		}
		logDown.setUecworklist(uecworkString);
		
		// 奖励
		
		List<UecEnc> findUecEncByOutStaffId = uecEncManager
				.findUecEncByOutStaffId(uecOutStaffInfo);
		String uecEncString="";
		
		if(findUecEncByOutStaffId != null && findUecEncByOutStaffId.size()>0) {
			for(UecEnc uecEnc:findUecEncByOutStaffId) {
				uecEncString=uecEncString+(!StrUtil.isNullOrEmpty(uecEnc.getDataCollection())?uecEnc.getDataCollection():"--")+"    "+
						(!StrUtil.isNullOrEmpty(uecEnc.getGlbdef1())?uecEnc.getGlbdef1():"--")+"    "+(!StrUtil.isNullOrEmpty(uecEnc.getEncourorg())?uecEnc.getEncourorg():"--")+"    "+
						(!StrUtil.isNullOrEmpty(uecEnc.getEncourrankName())?uecEnc.getEncourrankName():"--")+"\r\n";
			}
		}else {
			uecEncString="无";
		}
		logDown.setUecenclist(uecEncString);
		// 教育
		List<UecDocEdu> uecDocEduByUecOutStaffId = uecEduManager
				.getUecDocEduByUecOutStaffId(uecOutStaffInfo);
		String dataTemp="";
		//从事外包日期，
		for( int i=0;i<queryPageInfoByUecStaffId.size();i++) {
			UecWork uecWork = queryPageInfoByUecStaffId.get(0);
			if(!StrUtil.isNullOrEmpty(uecWork.getBegindate())){
			 dataTemp=uecWork.getBegindate();
			}
		}
		
		if(!StrUtil.isNullOrEmpty(nXbegindate)) {
			nXlist=nXgrade +"  "+(df1.format(nXbegindate)).replace("-", ".");
		}
		if(!StrUtil.isNullOrEmpty(nXenddate)) {
			nXlist=nXlist +" - "+(df1.format(nXenddate)).replace("-", ".");
		}
			
	  if(!StrUtil.isNullOrEmpty(dataTemp)) {
		  dataTemp=dataTraslate(dataTemp);
		}
		if(!StrUtil.isNullOrEmpty(dataTemp) && dataTemp.substring(4).length()<3) {
			dataTemp=dataTemp.substring(4)+"0"+dataTemp.substring(5);
		}
		if(!StrUtil.isNullOrEmpty(dataTemp)) {
			dataTemp=dataTemp.replace('-', '.');
			}
		
		String lastenducation = "——";
		String schoolEducation = "——";
		String majorEducation = "——";
		String studymodeEducation = "——";
		String pkdgreeName = "——";
		String school = "——";
		String major = "——";
		String studymode = "——";
		if (uecDocEduByUecOutStaffId != null && uecDocEduByUecOutStaffId.size()>0) {
			for (UecDocEdu u : uecDocEduByUecOutStaffId) {
				if ("Y".equals(u.getLasteducation())) {
					lastenducation = u.getEducationName();
					schoolEducation=u.getSchool();
					majorEducation = u.getMajor();
					logDown.setBesteducation(lastenducation);
					logDown.setBestschool(schoolEducation);
					logDown.setBestmajor(majorEducation);
					if(("1001A1100000000006B4").equals(u.getStudymode())) {
						studymodeEducation="是";
					}else {
						studymodeEducation="否";
					}
				}
				if ("Y".equals(u.getGlbdef4())) {
					if(!StrUtil.isNullOrEmpty(u.getPkDegree())) {
					   pkdgreeName = getPkDegreeName(u.getPkDegree());
				   }
					
					/*if(!StrUtil.isNullOrEmpty(u.getPkDegreeName())) {
						pkdgreeName = u.getPkDegreeName();
					}*/
					if(!"无".equals(pkdgreeName)) {
						school = u.getSchool();
						major = u.getMajor();
						logDown.setBestdegree(pkdgreeName);
						logDown.setBestdegreemajor(major);
						logDown.setBestdegreeschool(school);
						if(("1001A1100000000006B4").equals(u.getStudymode())) {
							studymode="是";
						}else {
							studymode="否";
						}
					}
					
				}
			}
			

		}
		 for(UecAss uecass:findUecAssByStaffId) {
				if (null != uecass.getGlbdef4()) {
					if (uecass.getGlbdef4().contains("16")) {
						logDown.setAss2016((!StrUtil.isNullOrEmpty(uecass.getPkPerankName())?uecass.getPkPerankName():""));
					} 
				  if (uecass.getGlbdef4().contains("17")) {
					  logDown.setAss2017((!StrUtil.isNullOrEmpty(uecass.getPkPerankName())?uecass.getPkPerankName():""));
				  }
				    } 
				  if (uecass.getGlbdef4().contains("18")) {
					  logDown.setAss2018((!StrUtil.isNullOrEmpty(uecass.getPkPerankName())?uecass.getPkPerankName():""));
				   } 
				
			}
		 logDown.updateOnly();
		Document document = new Document();// 1.新建document对象
		// 2.建立一个书写器(Writer)与document对象关联，通过书写器(Writer)可以将文档写入到磁盘中。
		// 创建 PdfWriter 对象 第一个参数是对文档对象的引用，第二个参数是文件的实际名称，在该名称中还会给出其输出路径。
		ByteArrayOutputStream os = new ByteArrayOutputStream();
		PdfWriter writer = PdfWriter.getInstance(document, os);
		// 设置只读权限(加密)
		// writer.setEncryption(null,null, PdfWriter.ALLOW_PRINTING,
		// PdfWriter.ENCRYPTION_AES_128);
		writer.setViewerPreferences(PdfWriter.PageModeUseThumbs);
		document.setPageSize(PageSize.A4);// 设置纸张大小
		// 3.打开文档
		document.open();
		// 中文字体,解决中文不能显示问题
		BaseFont bfChinese = BaseFont.createFont("STSong-Light",
				"UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
		Font blueFont = new Font(bfChinese,10,Font.NORMAL);//内容
		Font blueFont2 = new Font(bfChinese,10,Font.BOLD);//字段
		 Font blueFont1 = new Font(bfChinese, 16, Font.BOLD);//标题
		 Font blueFont3 = new Font(bfChinese, 10, Font.BOLD);//加*号字体为蓝色
		// blueFont3.setFamily(family);
		 blueFont3.setColor(BaseColor.BLUE);
		// 创建表格

		// 3列的表.
		// document.add(new
		// Paragraph("2018年中国电信内蒙古分公司面向派遣及业务外包公司人员招录员工报名表",blueFont));
		PdfPTable table = new PdfPTable(10);
		table.setWidthPercentage(100); // 宽度100%填充
		// table.setSpacingBefore(10f); // 前间距
		// table.setSpacingAfter(10f); // 后间距
		List<PdfPRow> listRow = table.getRows();
		// 设置列宽
		float[] columnWidths = { 1f, 1f, 1f, 1f, 1f, 1f, 1f, 1f,0.5f,1f};
		table.setWidths(columnWidths);

		// 行1
		PdfPCell cells3[] = new PdfPCell[10];
		PdfPRow row1 = new PdfPRow(cells3);
		cells3[0] = new PdfPCell(new Paragraph(
				"中国电信内蒙古分公司面向派遣及业务外包公司人员\r\n" + 
				"选聘员工报名表\r\n" + 
				"", blueFont1));// 单元格内容
		cells3[0].setColspan(10);
		cells3[0].disableBorderSide(1);
		//cells3[0].disableBorderSide(2);
		cells3[0].disableBorderSide(4);
		cells3[0].disableBorderSide(8);
		cells3[0].setPaddingBottom(25);
		cells3[0].setHorizontalAlignment(Element.ALIGN_CENTER);
		cells3[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		// 行
		/*PdfPCell cells18[] = new PdfPCell[10];
		PdfPRow row18 = new PdfPRow(cells18);
		cells18[0] = new PdfPCell(new Paragraph("填报时间", blueFont));// 单元格内容
		cells18[0].setColspan(8);
		cells18[0].disableBorderSide(1);
		cells18[0].disableBorderSide(4);
		cells18[0].disableBorderSide(8);
		cells18[0].setHorizontalAlignment(Element.ALIGN_RIGHT);
		cells18[8] = new PdfPCell(new Paragraph(y + "年" + (m+1) + "月" + d + "日",
				blueFont));
		cells18[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells18[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells18[8].setColspan(2);
		cells18[8].disableBorderSide(1);
		cells18[8].disableBorderSide(4);
		cells18[8].disableBorderSide(8);
		cells18[8].setHorizontalAlignment(Element.ALIGN_RIGHT);*/
		// 行2
		PdfPCell cells1[] = new PdfPCell[10];
		PdfPRow row2 = new PdfPRow(cells1);
		// 单元格
		cells1[0] = new PdfPCell(new Paragraph("姓名\r\n", blueFont2));// 单元格内容
		cells1[0].setPaddingBottom(8);
		cells1[0].setPaddingTop(8);
		cells1[3] = new PdfPCell(new Paragraph("性      别", blueFont2));// 单元格内容
		cells1[5] = new PdfPCell(new Paragraph("出生年月", blueFont2));// 单元格内容
		cells1[7] = new PdfPCell(new Paragraph("政治面貌", blueFont2));// 单元格内容
		// cells1[0].setBorderColor(BaseColor.BLUE);//边框验证
		// cells1[0].setPaddingLeft(20);//左填充20
		cells1[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中

		cells1[1] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getPsnName(), blueFont));
		cells1[4] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getSex(), blueFont));
		cells1[6] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getBirthdate(), blueFont));
		cells1[8] = new PdfPCell(new Paragraph(
				("".equals(uecOutStaffInfomationVo.getPartyName())?"":uecOutStaffInfomationVo.getPartyName()), blueFont));
		cells1[1].setColspan(2);
		cells1[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells1[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells1[4].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[4].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells1[5].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[5].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells1[6].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[6].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells1[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells1[8].setColspan(2);
		cells1[8].setPaddingBottom(8);
		cells1[8].setPaddingTop(8);
		cells1[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells1[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		// 行3
		PdfPCell cells2[] = new PdfPCell[10];
		PdfPRow row3 = new PdfPRow(cells2);
		cells2[0] = new PdfPCell(new Paragraph("从事外包或派遣\r\n"+"起始日期", blueFont2));
		cells2[0].setColspan(2);
		cells2[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells2[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells2[2] = new PdfPCell(new Paragraph(dataTemp, blueFont));
		cells2[2].setColspan(2);
		cells2[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells2[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells2[4] = new PdfPCell(new Paragraph("岗级档次", blueFont2));
		cells2[4].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells2[4].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells2[5] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getJobglbdef3(), blueFont));
		cells2[5].setColspan(2);
		cells2[5].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells2[5].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells2[7] = new PdfPCell(new Paragraph("健康状况", blueFont2));
		cells2[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells2[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells2[8] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getHealth(), blueFont));
		cells2[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells2[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells2[8].setColspan(2);
		// 行4
		PdfPCell cells4[] = new PdfPCell[10];
		PdfPRow row4 = new PdfPRow(cells4);
		cells4[0] = new PdfPCell(new Paragraph("专业人才\r\n"+"级别及聘期", blueFont2));
		cells4[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells4[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells4[0].setColspan(2);
		cells4[2] = new PdfPCell(new Paragraph("——", blueFont));
		if(!StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getTalentRank())) {
		  cells4[2] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getTalentRank(), blueFont));
		} 
		if(!StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getTalentRank()) && !"~".equals(uecOutStaffInfomationVo.getTalentDate())) {
			cells4[2] = new PdfPCell(new Paragraph(
					uecOutStaffInfomationVo.getTalentRank() +"   "+uecOutStaffInfomationVo.getTalentDate(), blueFont));
		} 
		cells4[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells4[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells4[2].setColspan(3);
		cells4[5] = new PdfPCell(new Paragraph("*内训师\r\n"+"级别及聘期", blueFont3));
		cells4[5].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells4[5].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells4[5].setColspan(2);
		cells4[7] = new PdfPCell(new Paragraph(nXlist, blueFont));
		cells4[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells4[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells4[7].setColspan(3);
		// 身份证号
		PdfPCell cells5[] = new PdfPCell[10];
		PdfPRow row5 = new PdfPRow(cells5);
		cells5[0] = new PdfPCell(new Paragraph("身份证号码", blueFont2));
		cells5[0].setPaddingBottom(10);
		cells5[0].setPaddingTop(10);
		cells5[0].setColspan(2);
		cells5[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells5[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells5[2] = new PdfPCell(new Paragraph(
				uecOutStaffInfomationVo.getIdNum(), blueFont));
		cells5[2].setColspan(8);
		cells5[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells5[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		// 学历三行
		PdfPCell cells6[] = new PdfPCell[10];
		PdfPRow row6 = new PdfPRow(cells6);
		cells6[0] = new PdfPCell(new Paragraph("学\r\n" + 
				"历\r\n" + 
				"学\r\n" + 
				"位\r\n" + 
				"", blueFont2));
		cells6[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells6[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells6[0].setRowspan(3);
		cells6[1] = new PdfPCell(new Paragraph("*原始学历\r\n" + "（取得高等教育之前的学历)"
				+ "", blueFont3));
		cells6[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells6[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells6[2] = new PdfPCell(new Paragraph(origedu, blueFont));
		cells6[3] = new PdfPCell(new Paragraph("*毕业院校", blueFont3));
		cells6[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells6[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells6[4] = new PdfPCell(new Paragraph(origSchool, blueFont));
		cells6[4].setColspan(3);
		cells6[7] = new PdfPCell(new Paragraph("*所学专业", blueFont3));
		cells6[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells6[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells6[8] = new PdfPCell(new Paragraph(origMajor, blueFont3));
		cells6[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells6[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells6[8].setColspan(2);
		PdfPCell cells7[] = new PdfPCell[10];
		PdfPRow row7 = new PdfPRow(cells7);
		cells7[0] = new PdfPCell(new Paragraph("", blueFont));
		cells7[0].disableBorderSide(1);
		cells7[0].disableBorderSide(2);
		cells7[1] = new PdfPCell(new Paragraph("最高学历\r\n" + 
				"/学位\r\n" + 
				"", blueFont2));
		cells7[1].disableBorderSide(2);
		cells7[1].setRowspan(2);
		cells7[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[1].setRowspan(2);
		cells7[2] = new PdfPCell(new Paragraph("学历", blueFont2));
		cells7[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[2].setPaddingTop(8);
		cells7[2].setPaddingBottom(8);
		cells7[3] = new PdfPCell(new Paragraph(lastenducation , blueFont));
		cells7[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[4] = new PdfPCell(new Paragraph("毕业\r\n" + 
				"院校\r\n" + 
				"", blueFont2));
		cells7[4].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[4].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[4].setRowspan(2);
		cells7[5] = new PdfPCell(new Paragraph(schoolEducation, blueFont));
		cells7[5].setPaddingTop(8);
		cells7[5].setPaddingBottom(8);
		cells7[5].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[5].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[6] = new PdfPCell(new Paragraph("所学\r\n" + 
				"专业\r\n" + 
				"", blueFont2));
		cells7[6].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[6].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[6].setRowspan(2);
		cells7[7] = new PdfPCell(new Paragraph(majorEducation, blueFont));
		cells7[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[8] = new PdfPCell(new Paragraph("是否\r\n" + 
				"全日\r\n" + 
				"制\r\n" + 
				"", blueFont2));
		cells7[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells7[8].setRowspan(2);
		cells7[9] = new PdfPCell(new Paragraph(studymodeEducation, blueFont));
		cells7[9].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells7[9].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		PdfPCell cells100[] = new PdfPCell[10];
		PdfPRow row100= new PdfPRow(cells100);
		cells100[0] = new PdfPCell(new Paragraph("", blueFont));
		cells100[0].disableBorderSide(1);
		cells100[1] = new PdfPCell(new Paragraph("", blueFont));
		cells100[1].disableBorderSide(1);
		cells100[2] = new PdfPCell(new Paragraph("学位", blueFont2));
		cells100[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells100[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells100[2].setPaddingTop(8);
		cells100[2].setPaddingBottom(8);
		cells100[3] = new PdfPCell(new Paragraph(pkdgreeName , blueFont));
		cells100[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells100[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells100[4] = new PdfPCell(new Paragraph("", blueFont));
		cells100[4].disableBorderSide(1);
		cells100[5] = new PdfPCell(new Paragraph(school, blueFont));
		cells100[5].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells100[5].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells100[6] = new PdfPCell(new Paragraph("", blueFont));
		cells100[6].disableBorderSide(1);
		cells100[7] = new PdfPCell(new Paragraph(major, blueFont));
		cells100[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells100[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells100[8] = new PdfPCell(new Paragraph("", blueFont));
		cells100[8].disableBorderSide(1);
		cells100[9] = new PdfPCell(new Paragraph(studymode, blueFont));
		cells100[9].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells100[9].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		PdfPCell cells8[] = new PdfPCell[10];
		PdfPRow row8 = new PdfPRow(cells8);
		cells8[0] = new PdfPCell(new Paragraph("现工作部门", blueFont2));
		cells8[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells8[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells8[0].setPaddingBottom(8);
		cells8[0].setPaddingTop(8);
		cells8[0].setColspan(2);
		cells8[2] = new PdfPCell(new Paragraph((StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getOrgName())?"——":uecOutStaffInfomationVo.getOrgName())+"     "+
				(StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getDeptName())?"——":uecOutStaffInfomationVo.getDeptName()), blueFont));
		cells8[2].setColspan(3);
		cells8[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells8[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells8[5] = new PdfPCell(new Paragraph("现任职务或岗位", blueFont2));
		cells8[5].setColspan(2);
		cells8[5].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells8[5].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells8[7] = new PdfPCell(new Paragraph(
				(StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getJobglbdef4())?" ":uecOutStaffInfomationVo.getJobglbdef4()), blueFont));
		cells8[7].setColspan(3);
		cells8[7].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells8[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		// 参加选聘报考类别
		PdfPCell cells9[] = new PdfPCell[10];
		PdfPRow row9 = new PdfPRow(cells9);
		cells9[0] = new PdfPCell(new Paragraph("参加选聘报考类别", blueFont2));
		cells9[0].setColspan(2);
		cells9[0].setPaddingBottom(8);
		cells9[0].setPaddingTop(8);
		cells9[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells9[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells9[2] = new PdfPCell(new Paragraph(joinCategory, blueFont));
		cells9[2].setColspan(8);
		cells9[2].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells9[2].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		// 考核信息
		PdfPCell cells10[] = new PdfPCell[10];
		PdfPRow row10 = new PdfPRow(cells10);
		cells10[0] = new PdfPCell(new Paragraph("年度个人绩效考核结果", blueFont2));
		cells10[0].setPaddingTop(8);
		cells10[0].setPaddingBottom(8);
		cells10[0].setColspan(10);
		cells10[0].setRowspan(1);
		cells10[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells10[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		PdfPCell cells11[] = new PdfPCell[10];
		PdfPRow row11 = new PdfPRow(cells11);
		cells11[0] = new PdfPCell(new Paragraph("2016年", blueFont2));
		cells11[0].setRowspan(2);
		cells11[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells11[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells11[3] = new PdfPCell(new Paragraph("2017年", blueFont2));
		cells11[3].disableBorderSide(2);
		cells11[3].setRowspan(2);
		cells11[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells11[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells11[6] = new PdfPCell(new Paragraph("2018年", blueFont2));
		cells11[6].setRowspan(2);
		cells11[6].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells11[6].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells11[1] = new PdfPCell(new Paragraph("", blueFont));
		cells11[4] = new PdfPCell(new Paragraph("", blueFont));
		cells11[7] = new PdfPCell(new Paragraph("", blueFont));
		if (findUecAssByStaffId != null && findUecAssByStaffId.size() > 0) {
			for (UecAss uecass : findUecAssByStaffId) {
				if (null != uecass.getGlbdef4()) {
					if (uecass.getGlbdef4().contains("16")) {
						cells11[1] = new PdfPCell(new Paragraph(
								uecass.getPkPerankName(), blueFont));
					} 
				  if (uecass.getGlbdef4().contains("17")) {
					cells11[4] = new PdfPCell(new Paragraph(
							uecass.getPkPerankName(), blueFont));
				    } 
				  if (uecass.getGlbdef4().contains("18")) {
					cells11[7] = new PdfPCell(new Paragraph(
							uecass.getPkPerankName(), blueFont));
				   } 
				}
			}	
		}
		    cells11[1].setColspan(2);
		    cells11[1].setRowspan(2);
			cells11[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells11[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			cells11[4].setColspan(2);
			cells11[4].setRowspan(2);
			cells11[4].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells11[4].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			
			cells11[7].setColspan(2);
			cells11[7].setRowspan(2);
			cells11[7].setHorizontalAlignment(Element.ALIGN_RIGHT);// 水平居中
			cells11[7].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			cells11[7].disableBorderSide(8);
			cells11[9] = new PdfPCell(new Paragraph(" ", blueFont));
			//cells11[9].setRowspan(2);
			cells11[9].disableBorderSide(4);
			cells11[9].disableBorderSide(2);
			PdfPCell cells31[] = new PdfPCell[10];
			PdfPRow row31 = new PdfPRow(cells31);
			cells31[0] = new PdfPCell(new Paragraph(" ", blueFont2));
			cells31[0].disableBorderSide(1);
			cells31[1] = new PdfPCell(new Paragraph(" ", blueFont2));
			cells31[1].disableBorderSide(1);
			cells31[1].setColspan(2);	
			cells31[3] = new PdfPCell(new Paragraph("", blueFont2));
			cells31[3].disableBorderSide(1);
			cells31[4] = new PdfPCell(new Paragraph("", blueFont2));
			cells31[4].disableBorderSide(1);
			cells31[4].setColspan(2);
			cells31[6] = new PdfPCell(new Paragraph("", blueFont2));
			cells31[6].disableBorderSide(1);
			cells31[7] = new PdfPCell(new Paragraph("", blueFont2));
			cells31[7].disableBorderSide(1);
			cells31[7].disableBorderSide(8);
			cells31[7].setColspan(2);
			cells31[9] = new PdfPCell(new Paragraph(" ", blueFont));
			cells31[9].disableBorderSide(4);
			cells31[9].disableBorderSide(1);
			
		// 个人人事档案存放地
		PdfPCell cells12[] = new PdfPCell[10];
		PdfPRow row12 = new PdfPRow(cells12);
		cells12[0] = new PdfPCell(new Paragraph("个人人事档案现存放单位", blueFont2));
		cells12[0].setColspan(3);
		cells12[0].setPaddingTop(8);
		cells12[0].setPaddingBottom(8);
		cells12[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells12[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells12[3] = new PdfPCell(new Paragraph(
				"".equals(uecOutStaffInfomationVo.getFileaddress()) ? " "
						: uecOutStaffInfomationVo.getFileaddress(), blueFont));
		cells12[3].setColspan(7);
		cells12[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells12[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		// 工作履历
		PdfPCell cells14[] = new PdfPCell[10];
		PdfPRow row14 = new PdfPRow(cells14);
		cells14[0] = new PdfPCell(new Paragraph("工\r\n" + 
				"作\r\n" + 
				"简\r\n" + 
				"历\r\n" + 
				"", blueFont2));
		cells14[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells14[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		if(queryPageInfoByUecStaffId.size()<=0) {
			cells14[0].setRowspan(4);
		}else {
			if(queryPageInfoByUecStaffId.size()<3) {
				cells14[0].setRowspan(4);
			}else {
				cells14[0].setRowspan(1+queryPageInfoByUecStaffId.size());
			}
			
		}
		
		cells14[1] = new PdfPCell(new Paragraph("起止年月", blueFont2));
		cells14[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells14[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells14[1].setColspan(2);
		cells14[1].setPaddingTop(8);
		cells14[1].setPaddingBottom(8);
		cells14[3] = new PdfPCell(new Paragraph("在何单位何部门任何职（岗位）", blueFont2));
		cells14[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells14[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells14[3].setColspan(5);
		cells14[8] = new PdfPCell(new Paragraph("*证明人", blueFont3));
		cells14[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells14[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells14[8].setColspan(2);
		listRow.add(row1);
		listRow.add(row2);
		listRow.add(row3);
		listRow.add(row4);
		listRow.add(row5);
		listRow.add(row6);
		listRow.add(row7);
		listRow.add(row100);
		listRow.add(row8);
		listRow.add(row9);
		listRow.add(row10);
		listRow.add(row11);
		listRow.add(row31);
		listRow.add(row12);
		listRow.add(row14);
		
		if(queryPageInfoByUecStaffId.size()<=0) {
			PdfPCell cells22[] = new PdfPCell[10];
			PdfPRow row22 = new PdfPRow(cells22);
			cells22[0] = new PdfPCell(new Paragraph(" ", blueFont));
			cells22[0].disableBorderSide(1);
			cells22[0].disableBorderSide(2);
			cells22[1] = new PdfPCell(new Paragraph("——", blueFont));
			cells22[1].setColspan(2);
			cells22[1].setPaddingTop(8);
			
			cells22[1].setPaddingBottom(8);
			cells22[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells22[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			cells22[3] = new PdfPCell(new Paragraph("——", blueFont));
			cells22[3].setColspan(5);
			cells22[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells22[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			cells22[8] = new PdfPCell(new Paragraph("——",blueFont));
			cells22[8].setColspan(2);
			cells22[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells22[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			listRow.add(row22);
			listRow.add(row22);
			listRow.add(row22);
		}else {
			if(queryPageInfoByUecStaffId.size()<3) {
	            for (int i = 0; i < queryPageInfoByUecStaffId.size(); i++) {
					UecWork uecwork = queryPageInfoByUecStaffId.get(i);
					if (uecwork != null) {
						PdfPCell cells[] = new PdfPCell[10];
						PdfPRow row = new PdfPRow(cells);
						cells[0] = new PdfPCell(new Paragraph("", blueFont));
						cells[0].disableBorderSide(1);
						cells[0].disableBorderSide(2);
						cells[1] = new PdfPCell(new Paragraph(uecwork.getDataCollection(), blueFont));
						cells[1].setColspan(2);
						cells[1].setPaddingTop(8);
						cells[1].setPaddingBottom(8);
						cells[3] = new PdfPCell(new Paragraph((StrUtil.isNullOrEmpty(uecwork.getWorkcorp())?" —— ":uecwork.getWorkcorp())
								+ "   " +  (StrUtil.isNullOrEmpty(uecwork.getWorkdept())?" —— ":uecwork.getWorkdept())+ "   "
								+ (StrUtil.isNullOrEmpty(uecwork.getWorkpost())?" —— ":uecwork.getWorkpost()), blueFont));
						cells[3].setColspan(5);
						cells[8] = new PdfPCell(new Paragraph(uecwork.getCertifier(),
								blueFont));
						cells[8].setColspan(2);
						cells[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
						cells[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
						cells[3].setHorizontalAlignment(Element.ALIGN_LEFT);// 水平居中
						cells[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
						cells[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
						cells[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
						listRow.add(row);
					}
				 }
				PdfPCell cells22[] = new PdfPCell[10];
				PdfPRow row22 = new PdfPRow(cells22);
				cells22[0] = new PdfPCell(new Paragraph(" ", blueFont));
				cells22[0].disableBorderSide(1);
				cells22[0].disableBorderSide(2);
				cells22[1] = new PdfPCell(new Paragraph("——", blueFont));
				cells22[1].setColspan(2);
				cells22[1].setPaddingTop(8);
				cells22[1].setPaddingBottom(8);
				cells22[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
				cells22[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
				cells22[3] = new PdfPCell(new Paragraph("——", blueFont));
				cells22[3].setColspan(5);
				cells22[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
				cells22[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
				cells22[8] = new PdfPCell(new Paragraph("——",blueFont));
				cells22[8].setColspan(2);
				cells22[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
				cells22[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
				for(int i=0;i<3-queryPageInfoByUecStaffId.size();i++) {
					listRow.add(row22);
				}
				
			}else {
				for (int i = 0; i < queryPageInfoByUecStaffId.size(); i++) {
		            
					UecWork uecwork = queryPageInfoByUecStaffId.get(i);
					if (uecwork != null) {
						PdfPCell cells[] = new PdfPCell[10];
						PdfPRow row = new PdfPRow(cells);
						cells[0] = new PdfPCell(new Paragraph("", blueFont));
						cells[0].disableBorderSide(1);
						cells[0].disableBorderSide(2);
						cells[1] = new PdfPCell(new Paragraph(uecwork.getDataCollection(), blueFont));
						cells[1].setColspan(2);
						cells[1].setPaddingTop(8);
						cells[1].setPaddingBottom(8);
						cells[3] = new PdfPCell(new Paragraph((StrUtil.isNullOrEmpty(uecwork.getWorkcorp())?" —— ":uecwork.getWorkcorp())
								+ "   " +  (StrUtil.isNullOrEmpty(uecwork.getWorkdept())?" —— ":uecwork.getWorkdept())+ "   "
								+ (StrUtil.isNullOrEmpty(uecwork.getWorkpost())?" —— ":uecwork.getWorkpost()), blueFont));
						cells[3].setColspan(5);
						cells[8] = new PdfPCell(new Paragraph(uecwork.getCertifier(),
								blueFont));
						cells[8].setColspan(2);
						cells[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
						cells[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
						cells[3].setHorizontalAlignment(Element.ALIGN_LEFT);// 水平居中
						cells[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
						cells[8].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
						cells[8].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
						listRow.add(row);
					}
				 }
			}
		
		}
		
		// 获得荣誉情况
		PdfPCell cells15[] = new PdfPCell[10];
		PdfPRow row15 = new PdfPRow(cells15);
		cells15[0] = new PdfPCell(new Paragraph("获得\r\n" + 
				"荣誉\r\n" + 
				"情况\r\n" + 
				"", blueFont2));
		cells15[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells15[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		if(findUecEncByOutStaffId.size()<=0) {
			cells15[0].setRowspan(2);
		}else {
			cells15[0].setRowspan(findUecEncByOutStaffId.size()+1);
		}
		cells15[1] = new PdfPCell(new Paragraph("授予年月", blueFont2));
		cells15[1].setColspan(2);
		cells15[1].setPaddingTop(8);
		cells15[1].setPaddingBottom(8);
		cells15[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells15[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells15[3] = new PdfPCell(new Paragraph("荣誉称号", blueFont2));
		cells15[3].setColspan(3);
		cells15[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells15[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells15[6] = new PdfPCell(new Paragraph("授予单位", blueFont2));
		cells15[6].setColspan(4);
		cells15[6].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells15[6].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		listRow.add(row15);
		if(findUecEncByOutStaffId.size()<=0) {
			PdfPCell cells21[] = new PdfPCell[10];
			PdfPRow row21 = new PdfPRow(cells21);
			cells21[0] = new PdfPCell(new Paragraph("", blueFont));
			cells21[0].disableBorderSide(1);
			cells21[0].disableBorderSide(2);
			cells21[1] = new PdfPCell(new Paragraph("——",blueFont));
			cells21[1].setColspan(2);
			cells21[1].setPaddingTop(8);
			cells21[1].setPaddingBottom(8);
			cells21[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells21[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			cells21[3] = new PdfPCell(new Paragraph("——",blueFont));
			cells21[3].setColspan(3);
			cells21[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells21[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			cells21[6] = new PdfPCell(new Paragraph("——",blueFont));
			cells21[6].setColspan(4);
			cells21[6].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
			cells21[6].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
			listRow.add(row21);
			//listRow.add(row21);
		}else {
			for (int i = 0; i < findUecEncByOutStaffId.size(); i++) {
				UecEnc uecenc = findUecEncByOutStaffId.get(i);
				if (uecenc != null) {
					PdfPCell cells20[] = new PdfPCell[10];
					PdfPRow row20 = new PdfPRow(cells20);
					cells20[0] = new PdfPCell(new Paragraph("", blueFont));
					cells20[0].disableBorderSide(1);
					cells20[0].disableBorderSide(2);
					cells20[1] = new PdfPCell(new Paragraph(uecenc.getDataCollection(),
							blueFont));
					cells20[1].setColspan(2);
					cells20[1].setPaddingTop(8);
					cells20[1].setPaddingBottom(8);
					cells20[3] = new PdfPCell(new Paragraph(uecenc.getGlbdef1(),
							blueFont));
					cells20[3].setColspan(3);
					cells20[6] = new PdfPCell(new Paragraph(uecenc.getEncourorg(),
							blueFont));
					cells20[6].setColspan(4);
					cells20[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
					cells20[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
					cells20[3].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
					cells20[3].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
					cells20[6].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
					cells20[6].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
					listRow.add(row20);
				}
			}
		}
		PdfPCell cells16[] = new PdfPCell[10];
		PdfPRow row16 = new PdfPRow(cells16);
		cells16[0] = new PdfPCell(new Paragraph("所在单位\r\n" + 
				"人力部门\r\n" + 
				"资格审查\r\n" + 
				"意见\r\n" + 
				"", blueFont2));
		cells16[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells16[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells16[0].setPaddingBottom(8);
		cells16[0].setPaddingTop(8);
		cells16[1] = new PdfPCell(
				new Paragraph("\r\n"+
						"审查人：                                                                                                                                                  （章）\r\n"+"\r\n"+
				      "                                                                                         年       月       日",
						blueFont));
		cells16[1].setColspan(9);
		PdfPCell cells17[] = new PdfPCell[10];
		PdfPRow row17 = new PdfPRow(cells17);
		String context = "本人郑重承诺：\r\n"+
				"本人已认真阅读并知悉填报内容及相关说明，对所填内容进行了认真核对，确保所填内容真实、准确、完整。如有弄虚作假、徇私舞弊的情况，自愿接受公司给予的处理：\r\n" + 
				"1.在全区范围内通报弄虚作假、徇私舞弊情况；\r\n" + 
				"2.不予承认选聘结果，不兑现相关待遇；\r\n" + 
				"3.追究相关领导、经办人员、应聘人责任，情节严重的，给予党纪政纪处分。\r\n" + 
				"";
		cells17[0] = new PdfPCell(new Paragraph("备注", blueFont2));
		cells17[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells17[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells17[1] = new PdfPCell(new Paragraph(context, blueFont));
		cells17[1].setColspan(9);
		cells17[1].setPaddingTop(8);
		cells17[1].setPaddingBottom(8);
		// 把行添加到集合
		listRow.add(row16);
		listRow.add(row17);
		PdfPCell cells25[] = new PdfPCell[10];
		PdfPRow row25 = new PdfPRow(cells25);
		cells25[0] = new PdfPCell(new Paragraph("\r\n应聘人(签名):\r\n" + 
				"\r\n" + 
				"日期：" +"\r\n"+" ", blueFont));
		cells25[0].setPaddingTop(8);
		cells25[0].setHorizontalAlignment(Element.ALIGN_LEFT);// 水平居左
		cells25[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells25[0].setColspan(10);
		listRow.add(row25);
		String contextString = "说明：\r\n" + "\r\n"+
				"1.符合条件人员本着自愿的原则，以个人名义向服务单位选聘工作组报名，以“线上报名”和“纸质报名”两种方式共同进行，即从线上导出报名表（PDF版）打印纸质版补充相关信息，本人核对并确认信息准确无误后（如信息有误，请联系所在单位人力资源部进行修改），由本人签字，递交或快递到所在地选聘工作组，截止日期2018年12月14日（星期五）。\r\n" + 
				 "\r\n"+
				"2.请登录“内蒙古全口径用工管理”系统（需通过公司内部网络登录）下载本表，用户名为“员工编码”，初始密码“123456”（请登录系统后及时修改密码），登录网址：http://136.224.44.1:19001/main/portal/ext/login_old。    \r\n" + 
				"\r\n"+
				"3.本报名表内容由全口径用工管理系统自动生成。其中：“*”内容为必填项，须应聘人手工填报。\r\n" + 
				"\r\n"+
				"4.报名表后须附相关内容的证明材料：\r\n" + 
				"\r\n"+
				"（1）身份证复印件（正反面）\r\n" + 
				"\r\n"+
				"（2）最高学历学位证明（学信网认证报告、党校函授学历证明、学位网认证报告）\r\n" + 
				"\r\n"+
				"（3）相关证明材料（荣誉表彰文件、集团级内训师聘任文件、管理序列人员需附现职务任职文件）。\r\n" + 
				"\r\n"+
				"5.“学历及学位”栏分为原始学历和最高学历/学位两类。填写的具体要求：\r\n" + 
				"\r\n"+
				"（1）“原始学历”指取得高等教育之前的学历。\r\n" + 
				"\r\n"+
				"（2）“最高学历/学位”应填写接受相应教育的最高学历、最高学位。\r\n" + 
				"\r\n"+
				"（3）“毕业院校”及“所学专业”栏填写与学历相对应的毕业院校、系和专业。 \f";
		
		Paragraph contextnew = new Paragraph(contextString, blueFont);
		PdfPCell cellsT[] = new PdfPCell[10];
		PdfPRow rowsT = new PdfPRow(cellsT);
		cellsT[0]=new PdfPCell(new Paragraph(contextString,blueFont));
		cellsT[0].disableBorderSide(1);
		cellsT[0].disableBorderSide(2);
		cellsT[0].disableBorderSide(4);
		cellsT[0].disableBorderSide(8);
		cellsT[0].setColspan(10);
		listRow.add(rowsT);
		PdfPCell cells13[] = new PdfPCell[10];
		PdfPRow row13 = new PdfPRow(cells13);
		cells13[0] = new PdfPCell(new Paragraph("*\r\n主\r\n" + 
				"要\r\n" + 
				"工\r\n" + 
				"作\r\n" + 
				"业\r\n" + 
				"绩\r\n" + 
				"", blueFont3));
		cells13[0].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells13[0].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		cells13[1] = new PdfPCell(new Paragraph("\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
		+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"+"\r\n"
	    + "                                                                        (400字以内)\r\n"
		
				, blueFont));
		cells13[1].setColspan(9);
		cells13[1].setHorizontalAlignment(Element.ALIGN_CENTER);// 水平居中
		cells13[1].setVerticalAlignment(Element.ALIGN_MIDDLE);// 垂直居中
		listRow.add(row13);	
		// 与上一段落（标题）的行距
		// contextnew.setSpacingBefore(10);
		// 设置第一行空的列数（缩进）
		// contextnew.setFirstLineIndent(15);
		// 把表格添加到文件中
		document.add(table);
		
		// 5.关闭文档
		document.close();

		/**
		 * 通过浏览器下载
		 */
		if (os != null) {
			byte[] bs = os.toByteArray();
			os.close();
			return bs;
		}
		return null;
	}
   public PdfPCell changeHeight(PdfPCell cell) {
	   cell.setMinimumHeight(2f);
	 return cell;  
   }
   
   /**
	 * 学位
	 * @return
	 */
	public String getPkDegreeName(String pkdegree) {
		if (!StrUtil.isNullOrEmpty(pkdegree)) {
			String sql = "SELECT * FROM UEC_BD_DEFDOC WHERE PK_DEFDOC = ? ";
			List<Object> params = new ArrayList<Object>();
			params.add(pkdegree);
			List<UecBdDefdoc> list = DefaultDaoFactory.getDefaultDao().jdbcFindList(sql,
					params, UecBdDefdoc.class);
			if (list != null && list.size() > 0) {
				return list.get(0).getName();
			}
		
		}
		return null;
	}
	 public String dataTraslate(String data) throws ParseException {
	    	SimpleDateFormat df=new SimpleDateFormat("yyyy-mm");
	    	Date parse = df.parse(data);
	    	String newDate = df.format(parse);
	    	return newDate;
	    }
	 //记录日志
	 public void initLogDown() {
		 try {
				if (StrUtil.isNullOrEmpty(PlatformUtil.getCurrentUser())) {
					ZkUtil.showError("当前登录用户不存在!", "错误提示");
					return;
				} else {
					logDown = new LogDown();
					String screenName = PlatformUtil.getCurrentUser().getScreenName();
					if("n".equals(screenName.substring(0,1).toLowerCase())) {
						screenName=screenName.substring(1);
						logDown.setStaffCatogery("合同制员工");
					}else {
						logDown.setStaffCatogery("外包员工");
					}
					uecOutStaffInfomationVo.setPsnCode(screenName.toUpperCase());
				}
				if (null == uecOutStaffInfo) {
					Messagebox.show("人员信息获取失败！");
					return;
				}else {
					//保存数据到log_down  日志操作
					SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:MM:SS");
					
					logDown.setPkPsndoc(uecOutStaffInfo.getPkPsnMsg());
					logDown.setSignno(2L);
					boolean flag = getLogDown(logDown);//判断数据库里是否已经存在，以免初次登录重新添加
					if(!flag) {
					//logDown=new LogDown();
						bean.getSubmitButton().setVisible(true);
			    		bean.getYetSubmitButton().setVisible(false);
			    		bean.getSubmitButton().setVisible(false);
			    		bean.getYetSubmitButton().setVisible(true);
					logDown.setDowntime(df.format(new Date()));
					logDown.setPkPsndoc(uecOutStaffInfo.getPkPsnMsg());
					logDown.setName(uecOutStaffInfo.getPsnName());
					logDown.setCode(uecOutStaffInfo.getPsnCode());
					logDown.setBirthdate(uecOutStaffInfomationVo.getBirthdate());
					logDown.setDownflag("N");
					logDown.setSex(uecOutStaffInfomationVo.getSex());
					//logDown.setEnterunittime(uecStaffAll.getEnterunittime());
					logDown.setWorkpostgrade(uecOutStaffInfomationVo.getJobglbdef3());
					//logDown.setJoinworkdate((!StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getJoinworkdate())?uecOutStaffInfomationVo.getJoinworkdate():""));
					logDown.setPartyName(("".equals(uecOutStaffInfomationVo.getPartyName())?"":uecOutStaffInfomationVo.getPartyName()));
					logDown.setOpenswitch("N");
					logDown.setCreatetime(df.format(new Date()));
					logDown.setWorkpostgrade(uecOutStaffInfomationVo.getJobglbdef4());
					logDown.setWorkorgdept(uecOutStaffInfomationVo.getDeptName());
					//logDown.setMobile((!StrUtil.isNullOrEmpty(uecStaffAll.getMobile())?uecStaffAll.getMobile():""));
					//logDown.setEmail((!StrUtil.isNullOrEmpty(uecStaffAll.getEmail())?uecStaffAll.getEmail():""));
					logDown.setWorkorg((!StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getOrgName())?uecOutStaffInfomationVo.getOrgName():""));
					logDown.setWbbegindate((!StrUtil.isNullOrEmpty(uecOutStaffInfomationVo.getWorkbegindate())?uecOutStaffInfomationVo.getWorkbegindate():""));
					/*
					 List<UecAss> findUecAssByStaffId = uecAssManager
							.findUecAssByStaffId(uecOutStaffInfo);
					  for(UecAss uecass:findUecAssByStaffId) {
						if (null != uecass.getGlbdef4()) {
							if (uecass.getGlbdef4().contains("16")) {
								logDown.setAss2016((!StrUtil.isNullOrEmpty(uecass.getPkPerankName())?uecass.getPkPerankName():""));
							} 
						  if (uecass.getGlbdef4().contains("17")) {
							  logDown.setAss2017((!StrUtil.isNullOrEmpty(uecass.getPkPerankName())?uecass.getPkPerankName():""));
						  }
						    } 
						  if (uecass.getGlbdef4().contains("18")) {
							  logDown.setAss2018((!StrUtil.isNullOrEmpty(uecass.getPkPerankName())?uecass.getPkPerankName():""));
						   } 
						
					}*/
					//logDown.setWorkorg((!StrUtil.isNullOrEmpty(uecStaffAll.getOrgname())?uecStaffAll.getOrgname():""));
					logDown.addOnly();
					}else {
						if("N".equals(logDown.getOpenswitch())) {
				    		bean.getSubmitButton().setVisible(true);
				    		//bean.getSaveButton().setVisible(true);
				    		bean.getYetSubmitButton().setVisible(false);
				    	}else {
				    		bean.getSubmitButton().setVisible(false);
				    		//bean.getSaveButton().setVisible(false);
				    		bean.getYetSubmitButton().setVisible(true);
				    	}
					}
				}
			} catch (Exception e) {			
				e.printStackTrace();
			} 
		 
	 }
	 public boolean getLogDown(LogDown logdown) throws ParseException {
		 boolean flag=false;
		 LogDown findLogDownByLogDown = logDownManager.findLogDownByLogDown(logdown);
		 if(findLogDownByLogDown!=null) {
			 flag=true;
			 logDown=findLogDownByLogDown;
			 joinCategory = !StrUtil.isNullOrEmpty(logDown.getJoincatogory())?logDown.getJoincatogory():"";
				origedu =!StrUtil.isNullOrEmpty(logDown.getOrignedu())?logDown.getOrignedu():"";
				origMajor =  !StrUtil.isNullOrEmpty(logDown.getOrigmajor())?logDown.getOrigmajor():"";
				 origSchool =  !StrUtil.isNullOrEmpty(logDown.getOrigschool())?logDown.getOrigschool():"";
				 nXlist = !StrUtil.isNullOrEmpty(logDown.getNxGrade())?logDown.getNxGrade():"";
		 }
		 return flag;
	 }
}